<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <base href="/">
    <meta http-equiv="X-UA-Compatible" content="IE = edge">
    <title>佣金管理</title>
    <link rel="stylesheet" type="text/css" href="lib/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="lib/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" type="text/css" href="css/login.css">
</head>

<body>
    <div class="login-form">
        <form autocomplete="off" onsubmit="return false;">
            <div class="login-group">
                <label>账号 : </label>
                <input type="text" autocomplete="off" prompt="请输入您的用户名" autocapitalize="off" autocorrect="off" class="easyui-textbox" name="uname" id="uname">
            </div>
            <div class="login-group">
                <label>密码 : </label>
                <input type="password" autocomplete="off" prompt="请输入您的密码" autocapitalize="off" autocorrect="off" class="easyui-textbox" name="pwd" id="pwd">
            </div>
            <div class="login-group">
                <input style="cursor: pointer;right:10px;" type="button" value="登陆系统" class="bn3 btn" />
            </div>
        </form>
    </div>
    <script type="text/javascript" src="lib/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="lib/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="lib/jquery.backstretch.min.js"></script>
    <script type="text/javascript" src="lib/jquery.cookie.js"></script>
    <script type="text/javascript">
        $(function() {
            var w = $(window).width();
            var h = $(window).height();
            $.backstretch([
                "img/005.jpg",
                "img/006.jpeg",
                "img/007.jpg"
            ], {
                duration: 8000,
                fade: 750,
                centeredX: true
            });
            $('.login-form').css({
                'marginLeft': 0.5 * w - 180,
                'marginTop': 0.4 * h - 110,
                'opacity': '0.95'
            });
            $('.btn').click(function(e) {
                $.post("/login/user", $('form').serialize(), function(data) {
                    if (data.status == 'success') {
                        $.cookie('token', data.token);
                        window.location = './default.html';
                    } else {
                        alert('您输入的帐户和密码不正确！');
                    }
                });
            })
        });
    </script>
</body>

</html>